from django.urls import path, re_path

from users.group import *
from users.views import *

app_name = 'users'
urlpatterns = [
    path('', IndexView.as_view(), name='index'),
    path('user_list/', UserListView.as_view(), name='list'),
    path('user_add/', UserAddView.as_view(), name='add'),
    re_path('user_modify/(?P<pk>[0-9]+)?/', UserUpdateView.as_view(), name='modify'),
    re_path('user_del/(?P<pk>[0-9]+)?/', UserDelateView.as_view(), name='del'),
    #re_path('user_add_group/(?P<pk>[0-9]+)?/',UserAddGroupView.as_view(),name='addgroup'),
    re_path('user_group/(?P<pk>[0-9]+)?/', UserGroupView.as_view(), name='user_group_update'),
    re_path('user_perm/(?P<pk>[0-9]+)?/', UserPermissionUpdateView.as_view(), name='user_perm_update'),
    re_path('reset_password/(?P<pk>[0-9]+)?/', ResetPasswordView.as_view(), name='reset_password'),


    path('group/', GroupListView.as_view(), name="group_list"),
    path('group_add/', GroupAddView.as_view(), name="group_add"),
    re_path('group_update/(?P<pk>[0-9]+)?/', GroupUpdateView.as_view(), name="group_update"),
    re_path('group_delete/(?P<pk>[0-9]+)?/', GroupDeleteView.as_view(), name="group_delete"),
    re_path('group_add_user/(?P<pk>[0-9]+)?/', AddUserToGroupView.as_view(), name='group_add_user'),

    path('permission/', PermListView.as_view(), name="perm_list"),
    path('permission_add/', PermAddView.as_view(), name="perm_add"),
    re_path('permission_update/(?P<pk>[0-9]+)?/', PermUpdateView.as_view(), name="perm_update"),
    re_path('permission_del/(?P<pk>[0-9]+)?/', PermDeleteView.as_view(), name="perm_delete"),



]
